package com.smartbone.entity;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Buysell entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "buysell", catalog = "stockmaster", uniqueConstraints = @UniqueConstraint(columnNames = "stockId"))
public class Buysell implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -2600602387642245466L;
	private Long id;
	private Stockinfo stockinfo;
	private Timestamp date;
	private Integer buysell;
	private Integer probability;
	private Float price;
	private Float syl;

	// Constructors

	/** default constructor */
	public Buysell() {
	}

	/** minimal constructor */
	public Buysell(Stockinfo stockinfo) {
		this.stockinfo = stockinfo;
	}

	/** full constructor */
	public Buysell(Stockinfo stockinfo, Timestamp date, Integer buysell,
			Integer probability, Float price, Float syl) {
		this.stockinfo = stockinfo;
		this.date = date;
		this.buysell = buysell;
		this.probability = probability;
		this.price = price;
		this.syl = syl;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "stockId", unique = true, nullable = false)
	public Stockinfo getStockinfo() {
		return this.stockinfo;
	}

	public void setStockinfo(Stockinfo stockinfo) {
		this.stockinfo = stockinfo;
	}

	@Column(name = "date", length = 19)
	public Timestamp getDate() {
		return this.date;
	}

	public void setDate(Timestamp date) {
		this.date = date;
	}

	@Column(name = "buysell")
	public Integer getBuysell() {
		return this.buysell;
	}

	public void setBuysell(Integer buysell) {
		this.buysell = buysell;
	}

	@Column(name = "probability")
	public Integer getProbability() {
		return this.probability;
	}

	public void setProbability(Integer probability) {
		this.probability = probability;
	}

	@Column(name = "price", precision = 12, scale = 0)
	public Float getPrice() {
		return this.price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	@Column(name = "syl", precision = 12, scale = 0)
	public Float getSyl() {
		return this.syl;
	}

	public void setSyl(Float syl) {
		this.syl = syl;
	}

}